<%--
  Created by IntelliJ IDEA.
  User: dell
  Date: 2018/11/14
  Time: 16:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link href="${pageContext.request.contextPath}/statics/hplus/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/statics/hplus/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/statics/hplus/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/statics/hplus/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/statics/hplus/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="${pageContext.request.contextPath}/statics/hplus/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script>
        function searcha(){
           var opts= $("#usertb").bootstrapTable("getOptions");
                var limit=opts.pageSize;
                var offset=(opts.pageNumber-1)*limit
                var username=$("#username").val();
                $.post("${pageContext.request.contextPath}/huiyuanChongzhi/chongzhifenye1",{"username":username,"offset":offset,"limit":limit},function (data) {
                    //重新绑定表格数据
                    $("#usertb").bootstrapTable('load',data);
                });
        }
        $(function () {
            $("#usertb").bootstrapTable({
                url:'${pageContext.request.contextPath}/huiyuanChongzhi/chongzhifenye1',
                pageSize:2,   //显示每页的条数
                pageList:[2,4,6,8],
                height:300,
                pageName:1,
                //启用分页，但是默认情况下，是客户端分页的
                pagination:true,
                //启用服务器端分页
                sidePagination:'server',
                queryParams:function(params){
                    var tmpe= {
                        limit:params.limit,    //页面大小
                        offset:params.offset,  //页码
                        username:$("username").val()
                    }
                    return tmpe;
                },
                columns:[
                    {
                        field:'chongzhi_Shijian',
                        title:'充值时间'
                    },
                    {
                        field:'huiyuan_Id',
                        title:'会员编号'
                    },
                    {
                        field:'huiyuan_Name',
                        title:'会员姓名'
                    },
                    {
                        field:'kaikanjine_Id',
                        title:'充值金额'
                    },
                    {
                        field:'chongzhi_Name',
                        title:'充值方式'
                    },
                    {
                        field:'dianpu_Name',
                        title:'充值店铺'
                    }
                ]

            });
        });
    </script>

</head>
<body>
<div class="panel panel-default">
    <div class="panel-body">
        <div class="row">
            <div class="col-sm-6">
                <a  class="btn btn-primary" href="/huiyuanChongzhi/fileDownload">
                    <span class="glyphicon-plus"> </span> &nbsp; 下载模板
                </a>

                <a  class="btn btn-primary" href="/huiyuanChongzhi/fileDownloadData">
                    <span class="glyphicon-plus"> </span> &nbsp; 下载数据
                </a>

            </div>
            <div class="col-sm-6">
                <form  class="form-inline pull-right">
                    <input id="username" type="text" placeholder="类别名称 " class="form-control">
                    <button class="btn btn-primary" onclick="searcha()" type="button"><span class="glyphicon glyphicon-search"></span>&nbsp;&nbsp;搜索</button>
                </form>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <table id="usertb"></table>
            </div>
        </div>

    </div>
</div>
</body>
</html>
